{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-header">{if condition="isset($data.title) "} 编辑年级{else}添加年级{/if}</div>
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">父类</label>
                <input type="hidden" name="id" value="{$data.id|default=''}" >
                <div class="layui-input-inline">
                    <select name="pid">
                        <option value="0">顶级菜单</option>
                        {foreach name="dormitory" item="v" empty="$empty"}
                        <option value="{$v.id}"{if condition="isset($data) and $data.pid eq $v.id"} selected="selected"{/if}>{$v.title} </option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">班级</label>
                <div class="layui-input-inline">
                    <input type="text" name="title" value="{$data.title|default=''}" autocomplete="off" placeholder="请输入班级" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 开发可见</label>
                <div class="layui-input-inline">
                    <input type="radio" name="dev" {if condition="isset($data) and $data.dev eq 1"} checked="checked"{/if} value="1" >是<input type="radio" name="dev" {if condition="isset($data) and $data.dev eq 0"} checked="checked"{/if} value="0" >否
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 状态</label>
                <div class="layui-input-inline">
                    <input type="radio" name="status" {if condition="isset($data) and $data.status eq 1"} checked="checked"{/if} value="1" >启用<input type="radio" name="status" {if condition="isset($data) and $data.status eq 0"} checked="checked"{/if} value="0" >禁用
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
